/**
 * Created by admin on 2017/3/30.
 */
$(function () {
    /*----------------------获取数据，添加数据---------------------------*/
    var agreementdata = "";
    var loanAgreement = function(){
        newDate = new Date();
        var data = {
            userName: '',
            companyName:'',
            bankId:'',
            bankAddress:'',
            userPhone:'',
            addTme:'',
            userCarId: '',
            lendingName:'深圳市前海辉誉金融服务有限公司'
        };
        agreementdata=data;
        var urls =tool.httpUrl+"/loan/findLoanOrderRecord";
        var head=tool.header;
        head.public_key=tool.GetQueryString("public_key");
        head.app_key=tool.GetQueryString("app_key");
        head.source=tool.GetQueryString("source");
        head.client_id=tool.GetQueryString("client_id");
        head.channel=tool.GetQueryString("channel");
        head.app_version=tool.GetQueryString("app_version");
        var datas={
            order_id:tool.GetQueryString("order_id").toString()
            //order_id:"864751513317175296"
        };
        var paramsStr = tool.getparamsStr(datas);
        var signaturesign = head.public_key + head.app_key + head.source + head.channel + head.client_id + head.app_version + paramsStr + head.timestamp;
        //签名信息MD5加密
        var signaturesignature = hex_md5(signaturesign);
        head.signature = signaturesignature;
        tool.ajax(urls, head, datas, function (data) {
           var datas=data.data;
            agreementdata.userName=datas.acct_name;
            agreementdata.companyName=datas.companyName||"";
            agreementdata.bankId=datas.bank_no;
            agreementdata.bank_name=datas.bank_name;
            agreementdata.userPhone=datas.telephone||"";
           var time= new Date(datas.create_time);
            var times=time.toLocaleDateString().split("/");
            var dataTime=times[0]+"年"+times[1]+"月"+times[2]+"日";
            agreementdata.addTme=dataTime;
            agreementdata.userCarId=datas.idcard_no;
        });

        var agreementData = new Vue({
            el: '#agreementUserDate',
            data: agreementdata
        });
    };
    loanAgreement();
});